#include "Log.hpp"
#include "ThreadPool.hpp"
#include <memory>
#include "task.hpp"

using namespace LogModule;
using namespace ThreadPoolModule;

int main()
{
    // Enable_Console_Log_Strategy();


    // ThreadPool<task_t> tp;
    int count = 10;
    while (count--)
    {
        // sleep(1);
        // ThreadPool<int>::GetInstance()->Enqueue(count);
        // std::cout << count << std::endl;
        // count--;

        ThreadPool<task_t>::GetInstance()->Enqueue(Download);
        sleep(1);
    }

    ThreadPool<task_t>::GetInstance()->Stop();
    ThreadPool<task_t>::GetInstance()->Join();



    //ThreadPool<int> *tp = new ThreadPool<int>();
    //tp->Start();
    // tp->Equeue(t);

    // // sleep(100);
    // // // tp->Stop();
    // //Enable_Console_Log_Strategy();
    // LOG(LogLevel::DEBUG) << "hello world" << 3.123;
    // LOG(LogLevel::DEBUG) << "hello world" << 3.144;

    // Enable_File_Log_Strategy();
    // LOG(LogLevel::DEBUG) << "hello world" << 3.143;
    // LOG(LogLevel::DEBUG) << "hello world" << 3.144;



    // std::unique_ptr<LogStrategy> strategy = std::make_unique<ConsoleLogStrategy>(); // C++14
    // std::unique_ptr<LogStrategy> strategy = std::make_unique<FileLogStrategy>(); // C++14
    // strategy->SyncLog("hello log!");
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world," << 3.14 << " " << 8899 << "aaaa";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(LogLevel::DEBUG, "main.cc", 10) << "hello world";
    return 0;
}